Skip to content

Init: Set OVN connection string only if necessary - #1505

Merged
roosterfish merged 2 commits into
canonical:mainfrom
roosterfish:fix_ovn_connection_string
Aug 18, 2026
Merged

Init: Set OVN connection string only if necessary#1505
roosterfish merged 2 commits into
canonical:mainfrom
roosterfish:fix_ovn_connection_string

Conversation

@roosterfish

Copy link
Copy Markdown
Contributor

Fixes #1286

Starting the with the ovn_dynamic_northbound_connection API extension in LXD, we don't anymore have to manually set the OVN northbound DB connection string. This also has the benefit that in case it requires a change, LXD always picks up the latest info from file setup by MicroOVN.

Starting the with the ovn_dynamic_northbound_connection API extension in LXD, we don't anymore have to manually set the OVN northbound DB connection string.
This also has the benefit that in case it requires a change, LXD always picks up the latest info from  file setup by MicroOVN.

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Comment thread test/includes/microcloud.sh Fixed
Comment thread test/includes/microcloud.sh Fixed
Comment thread test/includes/microcloud.sh Fixed
Comment thread test/includes/microcloud.sh Fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates MicroCloud’s init-time LXD configuration to avoid explicitly setting the OVN northbound DB connection string when LXD supports dynamically discovering it via MicroOVN’s ovn.env file (API extension: ovn_dynamic_northbound_connection), aligning initialization behavior with newer LXD capabilities.

Changes:

  • Gate setting network.ovn.northbound_connection on the absence of LXD’s ovn_dynamic_northbound_connection extension.
  • Adjust OVN validation in shell test helpers to skip connection-string validation when the extension is present.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
cmd/microcloud/main_init.go Conditionally sets LXD global OVN northbound connection config based on the LXD API extension.
test/includes/microcloud.sh Skips validating the northbound connection string when LXD can determine it dynamically.
Suppressed comments (1)

cmd/microcloud/main_init.go:935

  • This implements skipping the OVN northbound connection config when the LXD API extension is present, but it does not implement the required behavior of unsetting network.ovn.northbound_connection when the extension is present and the key was previously set (per the linked issue/PR description). As written, clusters upgraded to a new LXD will keep the stale global config indefinitely.
	newServer := server.Writable()
	changed := false
	for k, v := range config {
		if newServer.Config[k] != v {
			changed = true
		}

		newServer.Config[k] = v
	}

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/includes/microcloud.sh Outdated
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
@roosterfish
roosterfish force-pushed the fix_ovn_connection_string branch from 5c14f30 to 02c5c1f Compare August 18, 2026 08:01
@roosterfish
roosterfish marked this pull request as ready for review August 18, 2026 09:23

@nmezhenskyi nmezhenskyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@roosterfish
roosterfish merged commit 783ffc6 into canonical:main Aug 18, 2026
55 of 56 checks passed
@roosterfish
roosterfish deleted the fix_ovn_connection_string branch August 18, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't set network.ovn.northbound_connection if not required

4 participants